package com.example.demo.consumer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * @author wangyy
 * @date 2022/7/10
 */
@Component
@EnableBinding(OmsSink.class)
public class OmsConsumer {

    private Logger logger = LoggerFactory.getLogger(OmsConsumer.class);

    @StreamListener(OmsSink.CHANNEL_NAME_1)
    public void inputChannel1(String message) {
        logger.info("开始消费信道 1 消息:{}", message);
    }

    @StreamListener(OmsSink.CHANNEL_NAME_2)
    public void inputChannel2(String message) {
        logger.info("开始消费信道 2 消息:{}", message);
    }

}
